package com.tomehay.termprojectmanage_server.service.impl;

import com.tomehay.termprojectmanage_server.enums.ResponseCode;
import com.tomehay.termprojectmanage_server.pojo.Model.Clazz;
import com.tomehay.termprojectmanage_server.pojo.Model.Department;
import com.tomehay.termprojectmanage_server.mapper.DepartmentMapper;
import com.tomehay.termprojectmanage_server.pojo.VO.ResultVO;
import com.tomehay.termprojectmanage_server.service.DepartmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author tomehay
 * @since 2023-06-20
 */
@Service
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {
    @Resource
    DepartmentMapper departmentMapper;
    @Override
    public ResultVO<List<Department>> GetAllDepartments() {
        List<Department> departments = departmentMapper.selectList(null);
        return new ResultVO<>(ResponseCode.auto(departments),departments);
    }
}
